<?php
/**
 * shopify配置
 * (shopify-model)
 */
namespace App\Models\Shopify;

use Illuminate\Database\Eloquent\Model;

class ShopifyOrderCondition extends Model
{
    protected $connection = 'mysql_shopify';

    protected $table = 'shopify_order_condition';

    protected $guarded  = [];

    public static function getNextStartTime($shop){
        return self::query()->where('shop', $shop)->value('next_start_time');
    }

    public static function upNextStartTime($shop,$createdAtMax){
        return self::query()->updateOrCreate(['shop' => $shop],['next_start_time' => $createdAtMax]);
    }
}
